/**
 * Created by Administrator on 2017/3/23 0023.
 */
$('.hx_nc').click(function(){$('.core').show();});
$('.lm_js').click(function(){$('.introduction').show();});
$('.jc_hf').click(function(){$('.playback').show();});
$('.jc_lq').click(function(){$('.decision').show();});
$('.vip_fw').click(function(){$('.introduction1').show();});



$(".close").click(function () {
    var cls="."+$(this).attr("data-name");
    $(cls).hide();
    $("#popup").hide();
});
function closePopup(){
 $("#popup").hide();
};
function closeSmall(){
    $("#content6_small").hide();
    $("#content6").show();
};
function closeIntegral1(){
    $("#content6_integral1").hide();
    $("#content6").show();
};
$(".close1").click(function () {
    var cls="."+$(this).attr("data-name");
    $(cls).hide();
});
function errorHide(){
 var e=setTimeout(function () {
  $("#error").hide();
  clearTimeout(e);
 },2000);
};
function successHide(){
 var s=setTimeout(function () {
  $("#suc").hide();
  clearTimeout(s);
 },3000);
};
function flystart(_content){
 $("#fly_notice .re_sp").html(_content);
 $("#fly_notice .remind").css("left","70%");
 $("#fly_notice .remind").stop().animate({left:'-100%'},30000);
 setTimeout(function(){$("#fly_notice .remind").css("left","70%")},31000);
}
//切换内容
$(function(){
    $('#wz_li').on('click',function(){

     $("#hd").removeClass("ok").addClass("no");
     $("#wz").removeClass("no").addClass("ok");
     $("#chat_box1").hide();
     $("#chat_box2").show();
  });
  $('#hd_li').on('click',function(){
     $("#wz").removeClass("ok").addClass("no");
     $("#hd").removeClass("no").addClass("ok");
     $("#chat_box2").hide();
     $("#chat_box1").show();
  });
});

//鼠标悬停效果
 $(function(){
     $(".slider-panel ul li").hover(function(){

  $(this).children(".shadow").show();
 },function(){
    $(this).children(".shadow").hide();
 });
 });

function lookOne(thisBtn){
    var everyId=$(thisBtn).attr("data-id");
    $.ajax({
        url:"http://zbstest.guochengic.com/home/index/getShareOne",
        type:"POST",
        data:{
            "share_id":everyId
        },
        success: function (res) {
            if(res.code==0){
                var _html=escape2Html(res.data.introduce);
                $("#content6_small .small_box1 p").html(_html);
                $("#content6_small").show();
                $("#content6").hide();
            }else {
                $("#error").show();
                $("#errmsg").html(res.msg);
                errorHide();
                return;
            }
        }
    });
};
function lookRecommend(thisBtn){
    var recommendId=$(thisBtn).attr("data-id");
    $("#content6_integral1").show().attr("data-id",recommendId);
    $("#content6").hide();
};

function everySure(){
    $.ajax({
        url:"http://zbstest.guochengic.com/home/integral/decIntegral",
        type:"POST",
        success: function (res) {
            if(res.code==0){
                $("#content6").show();
                $("#content6_integral").hide();
            }else {
                $("#error").show();
                $("#errmsg").html(res.msg);
                errorHide();
                return;
            }
        }
    });
};
function userSign(){
    $.ajax({
        url:"http://zbstest.guochengic.com/home/integral/incIntegral",
        type:"POST",
        success: function (res) {
            if(res.code==0){
                $("#suc").show();
                $("#sucmsg").html(res.msg);
                successHide();
                return;
            }else {
                $("#error").show();
                $("#errmsg").html(res.msg);
                errorHide();
                return;
            }
        }
    })

};
function escape2Html(str) {
    var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'};
    return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];});
};
function getDate(){
    var date=new Date();
    var m=date.getMinutes();
    var h=date.getHours();
    m=time(m);
    h=time(h);
    var nowDate=h+":"+m;
    return nowDate;
};
function time(s){
    var t=s;
    if(s<10){
        s="0"+s;
    };
    return s;
};
